<?php
/**
 * @version     1.0.0
 * @package     com_events
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      JORGE EDUARDO DE O LIVEIRA LUCIANO <jeolcavaco@hotmail.com> - http://jorgeeduardo.wordpress.com
 */
// no direct access
defined('_JEXEC') or die;

//Load admin language file
$lang = JFactory::getLanguage();
$lang->load('com_events', JPATH_ADMINISTRATOR);

?>
<?php if ($this->item) : ?>



<div class="eventos container">
	<h3>Eventos</h3>
   
		<?php $show = false; ?>
        <?php 
        $item = $this->item;

        	$dia = substr($item->datestart, 8, 2) ;
       	 	$mes = substr($item->datestart, 5, 2) ;
       	 	$ano = substr($item->datestart, 0, 4) ;
       	 	$hora = substr($item->hourstart, 0, 5) ;
       	 	               
			if($item->state == 1 || ($item->state == 0 && JFactory::getUser()->authorise('core.edit.own',' com_events.evento.'.$item->id))):
				$show = true;
		?>
			<div class="b">
				<span>dia <?php echo $dia .'/'.$mes.'/'.$ano .' - '. $hora .'h';?></span>
				<span>local: <?php echo $item->local;?></span>
				<span>responsável: <?php echo $item->owner; ?></span>	
				<span><?php echo $item->title;?></span>
				<span class="intro"><?php echo $item->intro;?></span>
				
				<?php 	echo ($item->content); 	?>	
							
			</div>
			<?php endif; ?>
		
			<div class="btnback">
				<a href="javascript:window.history.back()" title="Voltar à página anterior" ><img src="<?php echo JUri::base() ?>templates/cmmacae/img/btnBack.jpg" /></a>
			</div>
</div>


   
<?php
else:
    echo JText::_('COM_EVENTS_ITEM_NOT_LOADED');
endif;
?>
